import { TOKEN_KEY, REMOVETOKEN_KEY, CHANNELS_ARR, TOUTIAO_SEARCHRESULT } from '@/store/mutation-type'
import { setStor, removeStor } from '@/config/storage'
export default {
    [TOKEN_KEY](state, data) {
        state.user = data
        setStor(TOKEN_KEY, state.user)
    },
    // 删除本地存储
    [REMOVETOKEN_KEY]() {
        removeStor(TOKEN_KEY)
    },
    // 本地存储频道
    [CHANNELS_ARR](state, data) {
        setStor(CHANNELS_ARR, data)
    },
    [TOUTIAO_SEARCHRESULT](state, data) {
        console.log(data);
        setStor(TOUTIAO_SEARCHRESULT, data)
    }
}
